home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / gfx / misc / PicSort.lha / PicSort / TH_IFX.rexx < prev   
OS/2 REXX Batch file  |  1997-08-09  |  771b  |  28 lines

  1. /* generate preview images via ImageFX*/
  2.  
  3.  
  4. options results
  5.  
  6. PARSE ARG source dest twidth theight dummy
  7.  
  8. path = Pragma("D")
  9. picsize = 120
  10.                       ADDRESS "IMAGEFX.1"
  11.                       LoadBuffer source FORCE
  12.  
  13.                       if RC = 0 THEN DO
  14.  
  15.                           Getmain
  16.                           width = SUBWORD(result,2,1)
  17.                           height = SUBWORD(result,3,1)
  18.  
  19.                           faktor = picsize/max(width,height)
  20.  
  21.                           newwidth = min(TRUNC(width * faktor),twidth)
  22.                           newheight = min(TRUNC(height * faktor),theight)
  23.  
  24.                           scale newwidth newheight
  25.  
  26.                           SaveBufferAs JPEG dest FORCE 85 PROGRESSIVE
  27.                           END
  28.